home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Now 11 / CD-ROM Now MegaDisc 11 (1995-02).iso / discs / x11r6 / install.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1994-10-04  |  1KB  |  69 lines

  1. #!/bin/sh
  2. #
  3. #  install.sh
  4. #  USAGE:  install.sh [-c]|[-l] [-s]|[-b] <cdrom_path> <install_path>
  5. #
  6. #  Install the binaries, fonts, libraries and header files for X11R6
  7. #
  8.  
  9. # fail on errors
  10. set -e
  11.  
  12. usage() {
  13.   echo 'usage: install.x11 [-c]|[-l] [-s]|[-b] <cdrom_path> <install_path>"' >&2
  14.   echo '       -c:  copy files' >&2
  15.   echo '       -l:  make symbolic links instead of copying' >&2
  16.   echo '       -s:  install for a Solaris host' >&2
  17.   echo '       -b:  install for a SunOS 4.1.3 host' >&2
  18.   echo '       cdrom_path: cdrom mount point (default is "/cdrom")' >&2
  19.   echo '       install_path: installation destination (default is "/usr/X11R6")' >&2
  20.   exit 1
  21. }
  22.  
  23. FROM="/cdrom"
  24. TO="/usr/X11R6"
  25.  
  26. case $# in
  27.   1) usage;;
  28.   2) ;;
  29.   3) FROM=$3;;
  30.   4) FROM=$3; TO=$4;;
  31.   *) usage;;
  32. esac
  33.  
  34. COPY=false
  35. LINK=false
  36.  
  37. case $1 in
  38.   "-c")  COPY=true;;
  39.   "-l")  LINK=true;;
  40.   "*") usage;;
  41. esac
  42.  
  43.  
  44. case $2 in
  45.   "-s") MACHINE=solaris;;
  46.   "-b") MACHINE=sun413;;
  47.   "*") usage;;
  48. esac
  49.  
  50. # print commands as they are executed
  51. set -x
  52.  
  53. if test ! -d $TO ; then
  54.     mkdir $TO
  55. fi
  56.  
  57. if test $COPY = true ; then
  58.     cp -rp $FROM/$MACHINE/* $TO;
  59.     $FROM/$MACHINE/bin/lndir $TO/lib /usr/lib;
  60. fi
  61.  
  62. if test LINK ; then
  63.     $FROM/$MACHINE/bin/lndir $FROM/$MACHINE $TO;
  64.     $FROM/$MACHINE/bin/lndir $TO/lib /usr/lib;
  65. fi
  66.  
  67.  
  68. exit
  69.